package com.starry.module.system.api.logger;

import com.starry.core.common.constants.ApplicationName;
import com.starry.core.common.domain.R;
import com.starry.feign.constants.RpcConstants;
import com.starry.module.system.api.logger.domain.qo.SysLogErrorQo;
import com.starry.module.system.api.logger.factory.SysLogErrorApiFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import static com.starry.module.system.constants.ApiConstants.API_PREFIX;


/**
 * RPC-异常日志
 *
 * @author xiaoke
 */
@FeignClient(value = ApplicationName.SYSTEM, contextId = "sysLogErrorApi", fallbackFactory = SysLogErrorApiFactory.class)
public interface SysLogErrorApi {

    String CREATE = RpcConstants.RPC_API_PREFIX + API_PREFIX + "/infraLogErrorCreate";

    /**
     * RPC-新增操作日志
     *
     * @param qo 新增参数
     * @return Long
     */
    @Operation(summary = "RPC-新增异常日志")
    @PostMapping(CREATE)
    R<Long> save(@RequestBody @Validated SysLogErrorQo qo);
}
